<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Redis学习笔记, Kevin&#39;s Blog">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>Redis学习笔记 | Kevin&#39;s Blog</title>
    <link rel="icon" type="image/png" href="/icon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 5.4.0"></head>




<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/icon.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">Kevin&#39;s Blog</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>博客主页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>博客归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于Kevin</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>查看大佬</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/icon.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">Kevin&#39;s Blog</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			博客主页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			博客归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于Kevin
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			查看大佬
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/ZKQevin" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/ZKQevin" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/9.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Redis学习笔记</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                          <div class="article-tag">
                            <span class="chip bg-color">无标签</span>
                          </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2021-03-29
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2021-03-29
                </div>
                

                

                

                
            </div>
        </div>
        <hr class="clearfix">

        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <p>中文官网地址：<a target="_blank" rel="noopener" href="http://www.redis.cn/">http://www.redis.cn</a><br>中文API文档地址：<a target="_blank" rel="noopener" href="http://redisdoc.com/">http://redisdoc.com</a></p>
<h1 id="一、部署Redis"><a href="#一、部署Redis" class="headerlink" title="一、部署Redis"></a>一、部署Redis</h1><p>1.安装</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]# yum -y install wget </span><br><span class="line">[root@localhost ~]# wget http:&#x2F;&#x2F;download.redis.io&#x2F;releases&#x2F;redis-6.0.6.tar.gz</span><br><span class="line">[root@localhost ~]# tar xzf redis-6.0.6.tar.gz</span><br><span class="line">[root@localhost ~]# cd redis-redis-6.0.6</span><br><span class="line">[root@localhost ~]# make   #提示报错选装GCC：yum install gcc-c++</span><br></pre></td></tr></table></figure>
<p>2.开启进程守护</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost redis-6.0.6]# vi  redis.conf</span><br><span class="line"></span><br><span class="line"># Note that Redis will write a pid file in &#x2F;var&#x2F;run&#x2F;redis.pid when daemonized.</span><br><span class="line">daemonize yes</span><br></pre></td></tr></table></figure>
<p>3.开启服务</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]# cd &#x2F;usr&#x2F;local&#x2F;bin&#x2F;</span><br><span class="line">[root@localhost bin]# redis-server  &#x2F;redis-6.0.6&#x2F;redis.conf</span><br><span class="line">[root@localhost bin]# redis-cli  -p 6379</span><br><span class="line">127.0.0.1:6379&gt; ping</span><br><span class="line">PONG</span><br></pre></td></tr></table></figure>
<p>4.关闭服务</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">127.0.0.1:6379&gt; shutdown</span><br><span class="line">not connected&gt; exit</span><br></pre></td></tr></table></figure>
<p>5.安装目录文件声明<br>redis-benchmark:性能测试工具，测试性能<br>redis-check-aof：修复有问题的AOF文件，<br>redis-check-dump：修复有问题的dump.rdb文件<br>redis-cli：客户端，操作入口<br>redis-sentinel：redis集群使用<br>redis-server：Redis服务器启动命令</p>
<p>参考于：<a target="_blank" rel="noopener" href="https://blog.csdn.net/yangliuhbhd/article/details/81317689">https://blog.csdn.net/yangliuhbhd/article/details/81317689</a></p>
<h1 id="二、Redis常用命令"><a href="#二、Redis常用命令" class="headerlink" title="二、Redis常用命令"></a>二、Redis常用命令</h1><p><strong>Redis五大数据类型String（字符串）、Hash（哈希类似Java的Map）、List（列表）、Set（集合）、Zset（有序集合）</strong></p>
<p><strong>①String</strong><br>1.添加：set [key] [value]。带生命周期添加：setex [key] [秒数] [value]。带判断存在添加：setnx [key] [value]。<br>2.查询：keys [*]<br>3.删除：DEL [key]。使用FLUSHDB：清除当前数据库，FLUSHALL：清除所有数据库<br>4.移动：MOVE [key] [所移数据库名]<br>5.设置过期时间：EXPIRE [key名] [秒数]，查看过期时间ttl [key名]，如果为-1表示永不过期，-2表示已过期。其它时间为倒数秒数，已经过期的数据就被删除了，不会再keys *中查询到。<br>6.只增加数字不增字符串：INCR/DECR [key名]，增/减一。同理INCRBY/DECRBY [key名] [数字]。<br>7.定点查看字符串：GETRANGE [key名] [前下标] [后下标] ，截取下标添加字符串命令：SETRANGE [key名] [始标] [内容]。<br>8.追加：APPEND [key名] [追加数据]，查询长度：STRLEN [key名]<br>9.批量新增：mset [key] [value] [key] [value]……。批量获取：mget [key] [key] [key]。带判断的新增有序集合（如果数据库已存在都不会成功）：msetnx [key] [value] [key] [value]……。</p>
<p><strong>②List</strong><br>1.列表LIST相关添加：分为LPUSH和RPUSH，LPUSH [key] [v1] [v2] [v3]……，分为左右进入，如果你是使用左边进的话LPUSH就是逆着出LRANGE，如果你是RPUSH就是顺着出来LRANGE。可以这样理解，当使用LRANGE时是从左到右进行输出，使用LPUSH是从中间往左边插入，使用RPUSH是从中间往右边输入。只有RPUSH是怎么进怎么出。<br>2.创建LIST列表，命令：lpush [key名] [数组]，查看：LRANGE [LISTkey名] 0 -1，查看类型type [key名]。<br>3.列表出栈命令：lpop [key]和rpop [key]，一个是从左边出栈，一个是从右边出栈。<br>4.通过下标获取list中的值，LINDEX [list] [下标值]，是从左到右数的。下标从0开始。获取长度：LLEN [list]。<br>5.删除N个value：LREM [list] [所删除的个数] [所删除的数字]，如果删除的个数大于本身存在的个数，他就会把存在的全部删了，不会报错。<br>6.截取出其中一段赋值给本身：LTRIM [list] [始标] [末标]。<br>7.右出栈左进栈：RPOPLPUSH [list01] [list02] 。就是把后面的list01的右边最后一个添加到list02的左边第一个。<br>8.通过下标更改某一个值：lset [key] [index] [value]。在某个地方前/后插值：LINSERT [key] [before/after] [本身存在value1] [新值value2]。</p>
<p><strong>③Set</strong><br>1.添加：sadd [set名] [value] [value] ……。如果有重复的，集合默认把重复的忽略进行添加不重复的值。<br>2.查询：SMEMBERS [set名]。查看一个值是否在集合中：SMEMBERS [set名] [value]。查看元素个数SCARD [set名]。<br>3.删除集合中的值：SREM [set] [value]。<br>4.随机出值个数：SRANDMEMBER [set] [个数]。可用来抽奖。随机出栈：spop [set]。<br>5.移动一个值到另外的集合中：SMOVE [set源] [set目标] [所移动值]。<br>6.差集：SDIFF [set1集合] [set2集合] ……。所得出的数字是以set1集合为目标，不在后面任何一个集合中的数字出现。<br>7.交集：SINTER [set1集合] [set2集合] ……。所得出的数字是在这些集合中都有的数字。<br>8.并集：SUNION [set1集合] [set2集合] ……。所得出的数字是在这些全部数字但是不重复。</p>
<p><strong>④Hash（KV模式不变，但是V又是一个键值对）</strong><br>1.添加hash：hset [hash-key] [value-key] [value]。表示前面是添加符号，value-key表示的是value的key名字，最后面才是真正的value。<br>2.批量添加hash：hmset [hash-key] [value-key1][value1] [value-key2][value2] ……。所添加的就是一key为名的hash。批量获得hash：hmget [hash-key] [value-key1] [value-key2] 就可获得他们的value。第二种批量获得是：HGETALL [hash-key] 。会批量的得到前面是key后面的value的hash。<br>3.删除hash中某个value-key的value：hdel [hash-key] [value-key]。<br>4.获得hash的长度：hlen [hash-key]。<br>5.检测value-key是否存在hash中：HEXITS [hash-key] [value-key]。返回1为存在，返回0位不存在。<br>6.获取hash中每个keys的值：HKEYS [hash-key]。获取hash中每个value的值：HVALUES [hash-key]<br>7.使hash中数字key的value增减：HINCRBY [hash-key] [value-key] [所增长数字]。如果是浮点就是：HINCRBYFLOAT [hash-key] [value-key] [所增长数字]。<br>8.带判断存在的填充进入hash：HSETNX [hash-key] [value-key] [value]。</p>
<p><strong>⑤Zset有序集合（相当于在set集合基础之上加一个score值）</strong><br>1.添加有序集合：zadd [zset-key] [score1] [value1] [score2] [value2] ……。意思为后面的每个score和value是绑定到一起的是一个value。<br>2.序列输出：ZRANGE [zset-key] [0始标] [-1终标]。带有分数的序列输出：ZRANGE [zset-key] [始标] [终标] withscores。<br>3.输出范围的序列：ZRANGEBYSCORE [zset-key] [始分] [终分]。不包含命令：ZRANGEBYSCORE [zset-key] （[始分] （[终分]。在范围前加一个“（”表示不包含这个数。从范围序列中再进行筛选：ZRANGEBYSCORE [zset-key] [始分] [终分] limit [始标] [所取个数]。<br>4.删除某个值：ZREM [zset-key] [value]。把分数和value是一起删除的。<br>5.统计个数：ZCARD [zset-key]：分数和value是一体的，所以只有value的个数。<br>6.统计范围scores的个数：ZCOUNT [zset-key] [始分] [终分]。<br>7.顺序统计排名（以0开始）：ZRANK [zset-key] [value]。根据值输出对应分数：ZSCORE [zset-key] [value]。<br>8.逆序统计排名：ZREVRANK [zset-key] [value]。逆序获得名次。逆序统计名次输出：ZREVRANGE [zset-key] [0始标] [-1终标]。</p>
<h1 id="三、Redis如何持久化"><a href="#三、Redis如何持久化" class="headerlink" title="三、Redis如何持久化"></a>三、Redis如何持久化</h1><p>1.RDB、AOF。<br>2.RDB、AOF在指定的时间间隔内将内存中的数据集快照写入磁盘，<br>也就是行话讲的Snapshot快照，它恢复时是将快照文件直接读到内存里。Redis会单独创建（ fork）一个子进程来进行持久化，会先将数据写入到一个临时文件中，待持久化过程都结束了，再用这个临时文件替换上次持久化好的文件。整个过程中，主进程是不进行任何IO操作的，这就确保了极高的性能。如果需要进行大规模数据的恢复，且对于数据恢复的完整性不是非常敏感，那RDB方式要比AOF方式更加的高效。RDB的缺点是最后一次持久化后的数据可能丢失。Fork的作用是赋值一个与当前进程一样的进程。新进程的所有数据（变量、环境变量、程序计数器等）数值都和原进程一致，但是是一个全新的进程，并作为原进程的子进程。<img src="https://img-blog.csdnimg.cn/20210129110414469.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQxMDQ5Mzcx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>3.在redis.conf配置文件中，系统会默默的给您生成三个策略，把dump.rdb保存到你的磁盘当中，这就是实现的持久化。<br>4.redis数据库中，运维会帮您把dump.rdb进行远程备份。当您使用FLUSHALL的时候清空了数据库在使用SHUTDOWN的时候他就将已经清空了的数据库保存下来了。所以这样下次就不能自动加载dump.rdb进行自动回复，需要下载dump.rdb进行恢复。简单来说：每次使用SHUTDOWN也会保存一次dump.rdb但是没有意义。如果有一个重要的数据需要保存，所以马上备份就是直接使用save命令，全部阻塞只管保存。bgsave是异步请求，一边保存一边接受新的增删。<br>5.RDB是非常紧凑文件，在保存文件父进程fork出子进程工作全由子进程做，所以RDB持久化方式可以最大化redis的性能。与AOF相比，恢复大的数据集时，RDB更快。缺点：丢失数据风险大，fork过程耗时间不能及时响应。<br>6.AOF：Append Only File：是在redis.conf配置文件append中默认关闭，我们将它开启之后它就会每次记录写入的操作。<br>7.AOF和RDB能够同时存在的，Redis启动时先读取AOF，如果AOF出现问题那么Redis启动被拒绝。如何解决？使用redis-check-aof自动帮你删除掉不符合它语法逻辑的，截断后面的。<br>8.重写原理，Redis会记录上次重写时的AOF大小，默认配置是当AOF大小是上次rewrite后大小的已被且文件大于64M时触发。但是现在至少的3GB起步了。<br>9.AOF文件是一个只进行追加的日志文件，Redis可以在AOF文件体积变得过大时，自动后台进行重写。AOF文件有序保存了对数据库写入操作，以Redis协议的格式保存，因此AOF文件的内容非常让人容易读懂。缺点：对于RDB来说AOF文件要大很多，根据fsync策略，AOF速度慢于RDB。<br>10.最终的性能建议：RDB作为后备策略，主要使用AOF来进行数据持久化。</p>
<h1 id="四、事务"><a href="#四、事务" class="headerlink" title="四、事务"></a>四、事务</h1><p>1.开启事务：MULTI。通常返回OK，之后进行的每个命令返回的都是QUEUED，最后使用EXEC就会返回一个队列为前面所执行的每一个结果输出。放弃事务不提交：DISCARD。<br>2.全体连坐：中间有一个出错了的话（注意是在加入队列的时候就报错(error)，相当于Java的编译时报错，这样的出错叫做全体连坐），事务提交不上去，所以就没有这一条事务，对应原子性。<br>3.冤头债主：中间有一个是出错了（但是他出错在加入队列的时候是能够加进去的，返回QUEUED而不是报错信息）这样最后提交事务EXEC那么错误的那条报错，其它的是能够提交上去的。<br>4.表锁：使用的时候整表锁住，一致性最高，并发性极差。行锁：加锁力度小一点，一致性一般，并发性较好。<br>5.悲观锁：相当于表锁，把整张表都锁住，每次使用都上锁，知道下一个拿到锁之后才能进行修改。乐观锁：相当于GitHub的Push推送，需要将最新版本号Pull下来之后在进行修改后在Push，这样在保证并发性的同时并保持一致性，策略：提交的版本必须大于记录当前版本才能执行更新。<br>6.Watch监控（类似于乐观锁）：假设一个信用卡时间，我这次使用了几块钱，下次就要换几块钱。使用balance和debt进行验证，初始为100和0。我们开始使用watch监控到balance之后，如果balance没有在其他线程进行修改那么它开启事务MULTI之后再进行decrby balance 20，incrby debt 20。最终提交exec那么它会出结果为80和20。  但是，如果在watch监控balance之后，另外一个线程去改变了balance的量之后，我们再进行之前的事务操作，事务就会失败。<br>7.UNwatch取消监控：第六条Watch监控失效之后，你所监控的key被修改了，那么需要使用UNwatch取消监控。之后在使用watch监控最新的版本，来进行开启事务MULTI，进行提交EXEC事务。这样就会成功。<br>8.一旦执行了EXEC或UNwatch之前被监控的所有key都被结算了。所以要重新监控。<br>9.了解redis有消息发布订阅。订阅：SUBSCRIBE [key1] [key2] [key3]……。另一个线程发布：PUBLISH [key名] [消息]。模糊订阅：PSUBSCRIBE [key]*，另一个线程发布：PUBLISH [key只要包含前一个key中的] [消息]。都会被接收到。</p>
<h1 id="五、主从复制"><a href="#五、主从复制" class="headerlink" title="五、主从复制"></a>五、主从复制</h1><p>1.Master用来写，Slave用来读。复制三个redis.conf，分别在redis后面加上端口号6379/80/81，之后进行配置他们的pidfile以及端口号和日志文件输出和dump+端口号。<br>2.分别使用三个配置文件开启端口号79 80 81的数据库，之后在使用info replication可以查看当前端口数据库是主还是从。之后从数据库使用SLAVEOF [ip地址] [端口号]来进行跟随主。并且在跟随主之前的数据都会被拷贝过来。<br>3.只有主机才能写，从机器只能读权限，所以他们写不了东西上去。<br>4.如果主机倒了，那么从机还是从机，不能变为主机，使用info replication还是从机。主机修复了之后从机依然跟随主机，不会发生任何改变，依然能够查询到主机添加的数据。<br>5.如果从机倒了，再进行端口打开连接，info replication那么他就从从机身份变成了主机身份，但是他是另外的一个主机身份，并不能查到之前主机数据库中的数据。除非写进了配置文件，不然都要重新连接主机。<br>6.一个主机可以有多个从机，但是一个从机只能有一个主机，从机可以跟随另外的一个从机，那么另外的中间从机它又是主机又是从机，但是它本身是不能写的所以这就形成了一个类似的链表结构。<br>7.中途变更转向：会清除之前的数据，重新读取新的主机的数据。<br>8.反客为主：SLAVEOF on noe。可以将主机已经下线的从机又变为新的主机。<br>9.哨兵模式：反客为主自动版。配置哨兵：sentinel monitor host6379 127.0.0.1 6379 1意思是代表监视6379的主机，如果SHUTDOWN了就后面跟随的从机器，谁的票数大于1就是谁是新主机。开启哨兵：redis-sentinel [sentinel.conf路径]。现在主机倒了，另外的从机会进行投票选出新的主机，而且不影响运行。但是如果倒掉的主机又重新连接上了，哨兵会将主机安排跟随新上位的从机。</p>
<h1 id="六、IDEA中如何使用Jedis"><a href="#六、IDEA中如何使用Jedis" class="headerlink" title="六、IDEA中如何使用Jedis"></a>六、IDEA中如何使用Jedis</h1><p>1.在IDEA中常用命令使用方法，先New一个Jedis(“ip地址”,”端口号”);之后方法基本上都是与命令行是差不多的。<br>2.IDEA中开启事务：jedis.multi();提交事务：jedis.exec();开始监控：jedis.watch(‘keys名’);<br>3.模拟网络阻塞时被监控目标被修改情况：在watch之后使用一个线程睡眠，与此同时在linux界面上去修改这个被监控的值，这样事务不会被提交。<br>4.测试主从复制，new Jedis两个不同的端口号。之后从机.slaveof(“IP地址”，端口号)，主机set值之后从机可以get到。</p>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">Kevin</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://example.com/2021/03/29/Redis%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">http://example.com/2021/03/29/Redis%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/about" target="_blank">Kevin</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            <span class="chip bg-color">无标签</span>
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">您的赏识是我前进的动力！</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2021/03/29/Spring%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/13.jpg" class="responsive-img" alt="Spring学习笔记">
                        
                        <span class="card-title">Spring学习笔记</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2021-03-29
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-user fa-fw"></i>
                            Kevin
                            
                        </span>
                    </div>
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2021/03/29/MyBatisPlus/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/21.jpg" class="responsive-img" alt="MybatisPlus">
                        
                        <span class="card-title">MybatisPlus</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2021-03-29
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-user fa-fw"></i>
                            Kevin
                            
                        </span>
                    </div>
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="2039019608"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 15px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2021</span>
            
            <span id="year">2021</span>
            <a href="/about" target="_blank">Kevin</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <span id="sitetime">载入运行时间...</span>
            <script>
                function siteTime() {
                    var seconds = 1000;
                    var minutes = seconds * 60;
                    var hours = minutes * 60;
                    var days = hours * 24;
                    var years = days * 365;
                    var today = new Date();
                    var startYear = "2021";
                    var startMonth = "3";
                    var startDate = "29";
                    var startHour = "0";
                    var startMinute = "0";
                    var startSecond = "0";
                    var todayYear = today.getFullYear();
                    var todayMonth = today.getMonth() + 1;
                    var todayDate = today.getDate();
                    var todayHour = today.getHours();
                    var todayMinute = today.getMinutes();
                    var todaySecond = today.getSeconds();
                    var t1 = Date.UTC(startYear, startMonth, startDate, startHour, startMinute, startSecond);
                    var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond);
                    var diff = t2 - t1;
                    var diffYears = Math.floor(diff / years);
                    var diffDays = Math.floor((diff / days) - diffYears * 365);
                    var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours);
                    var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) /
                        minutes);
                    var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours -
                        diffMinutes * minutes) / seconds);
                    if (startYear == todayYear) {
                        document.getElementById("year").innerHTML = todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffDays + " 天 " + diffHours +
                            " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    } else {
                        document.getElementById("year").innerHTML = startYear + " - " + todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffYears + " 年 " + diffDays +
                            " 天 " + diffHours + " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    }
                }
                setInterval(siteTime, 1000);
            </script>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/ZKQevin" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:773116395@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=773116395" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 773116395" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

	<script src="https://cdn.jsdelivr.net/gh/Mculover666/live2d-widget/autoload.js"></script>
</body>

</html>
